package com.gs.core.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
@DiscriminatorValue(value="VENDOR")
public class Vendor extends Person {
	private String vendorCode;
	private String status;
	private User client;
	public Vendor() {
	}
	private Vendor(String vendorCode, String status){
		this.vendorCode = vendorCode;
		this.status = status;
	}
	
	public static Vendor create(String vendorCode, String status){
		return new Vendor(vendorCode,status);
	}
	
	@Column(name="CODE")
	public String getVendorCode() {
		return vendorCode;
	}
	public void setVendorCode(String vendorCode) {
		this.vendorCode = vendorCode;
	}
	@Column(name="STATUS")
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	@ManyToOne
	@JoinColumn(name="CLIENT_ID")
	public User getClient() {
		return client;
	}

	public void setClient(User client) {
		this.client = client;
	}
	
}
